package Example4.Example18;

import java.sql.SQLOutput;

class Animal{
    void shout(){
        System.out.println("动物叫!");
    }
  public  String toString(){
        return "我是动物类";
    }
}
class Dog extends Animal{
    void shout(){
        System.out.println("狗叫!");
    }
}
public class Example18 {
    public static void main(String[] args) {
        Animal animal=new Animal();
        System.out.println(animal.toString());
    }
}
